/* Copyright (C) 2015-2016 HangZhou Zenzet Technology Co., Ltd.
 * All right reserved

 * File:crypto/locketlog.h
 * Author:guojianchuan/max
 * Date:2016-06-02

 */


#ifndef _LOCKET_LOG_H_
#define _LOCKET_LOG_H_

#ifdef __cplusplus
extern "C" {
#endif

/**
* @enum:LOG_LEVEL_E
* @Author: guojianchuan/max
* @Date: 2016-06-14
* @Description: log level
* @caution: 
*/
typedef enum tagLogLevel
{
    LOG_LEVEL_FALTAL = 0,       /* Faltal error, unrecoverable.eg: SDK init failed*/
    LOG_LEVEL_ERROR,            /* Normal error, recoveralbe. eg:function failed */
    LOG_LEVEL_WARN,             /* Warning. eg: Cpu load is too higer */
    LOG_LEVEL_DEBUG,            /* Debug message. eg: Prompt a new connection */
    LOG_LEVEL_INFO              /* Info message. eg: Tips "SDK init OK" */
}LOG_LEVEL_E;

void LOCKET_LOG_RegisterModule(IN int iLogModuleID, IN char *pcLogModuleName);

void LOCKET_LOG_Write(IN LOG_LEVEL_E enErrLevel, 
                      IN int iLogModuleID, 
                      IN char *pcFile, 
                      IN int iLine, 
                      IN char *pcFmt, ...);
#define LOG_ENABLE
#ifdef LOG_ENABLE
#define LOCKET_LOGDEBUG(pcFmt, args...)\
    LOCKET_LOG_Write(LOG_LEVEL_DEBUG, 0, __FILE__, __LINE__, pcFmt,  ##args)
#define LOCKET_LOGERROR(pcFmt, args...)\
    LOCKET_LOG_Write(LOG_LEVEL_ERROR, 0, __FILE__, __LINE__, pcFmt,  ##args)
#else
#define LOCKET_LOGDEBUG(pcFmt, args...)  
#define LOCKET_LOGERROR(pcFmt, args...)  
#endif

#ifdef __cplusplus
}
#endif

#endif  /* _LOCKET_LOG_H_ */
